package com.xm.servlet.background.orders;

import com.xm.service.background.OrdersService;
import lombok.SneakyThrows;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 更改货源
 * @author 康文程
 * @date 2024-1-11
 */
@WebServlet("/background/change/source")
public class ChangeSourceServlet extends HttpServlet {
    private final OrdersService service = new OrdersService();
    @SneakyThrows
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
        String orderId = req.getParameter("orderId");
        String warehouseId = req.getParameter("warehouseId");
        resp.getWriter().print(service.updateWarehouseIdByOrderId(orderId, Integer.parseInt(warehouseId)));
    }
}
